<?php 
$this->E_D("DROP TABLE IF EXISTS `db_cat_field`;");
$this->E_C("CREATE TABLE `db_cat_field` (
  `field_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `field` varchar(50) NOT NULL DEFAULT '' COMMENT '字段名',
  `name` varchar(30) NOT NULL DEFAULT '' COMMENT '别名',
  `fieldtype` varchar(30) NOT NULL COMMENT '字段类型',
  `fieldlen` varchar(20) NOT NULL COMMENT '长度',
  `formtype` varchar(20) NOT NULL DEFAULT '' COMMENT '字段类型',
  `tips` text COMMENT '字段提示',
  `pattern` varchar(255) NOT NULL DEFAULT '' COMMENT '数据校验正则',
  `errortips` varchar(255) DEFAULT '' COMMENT '数据校验未通过的提示信息',
  `savefun` varchar(255) DEFAULT NULL,
  `savefun_trigger` varchar(50) DEFAULT NULL,
  `issystem` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '是否主表',
  `isunique` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '值唯一',
  `sort` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `formwidth` smallint(4) DEFAULT NULL COMMENT '元素宽度',
  `formheight` smallint(4) DEFAULT NULL COMMENT '元素高度',
  `imgwidth` smallint(4) DEFAULT '0',
  `imgheight` smallint(4) DEFAULT '0',
  `defaultval` text COMMENT '默认值',
  `htmlcode` longtext COMMENT 'html代码',
  PRIMARY KEY (`field_id`),
  KEY `field` (`field`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8 COMMENT='模型字段列表'");
$this->E_D("replace into `db_cat_field` values('1','gourl','跳转链接','varchar','255','text','','','','','|add|update|import_add|import_update|','1','0','0','0','0','1000','0','','<div class=\"layui-form-item\">
  <label class=\"layui-form-label\">{modelFieldTemp_name}<span></span></label>
  <div class=\"layui-input-inline\">
	<input type=\"text\"  placeholder=\"\" name=\"gourl\" id=\"info_gourl\" class=\"layui-input modelform_gourl\" value=\"{\$r?\$r[''gourl'']:''''}\" style=\"\" autocomplete=\"off\">
  </div>
</div>	');");
$this->E_D("replace into `db_cat_field` values('2','entitle','英文标题','varchar','','text','','','','','|add|update|import_add|import_update|','1','0','0','0','0','1000','0','','<div class=\"layui-form-item\">
  <label class=\"layui-form-label\">{modelFieldTemp_name}<span></span></label>
  <div class=\"layui-input-inline\">
	<input type=\"text\"  placeholder=\"\" name=\"entitle\" id=\"info_entitle\" class=\"layui-input modelform_entitle\" value=\"{\$r?\$r[''entitle'']:''''}\" style=\"\" autocomplete=\"off\">
  </div>
</div>	');");
$this->E_D("replace into `db_cat_field` values('3','icon','图标','varchar','','image','','','','','|add|update|import_add|import_update|','1','0','0','0','0','1000','0','','<div class=\"layui-form-item\">
  <label class=\"layui-form-label\">{modelFieldTemp_name}<span></span></label>
  <div class=\"layui-input-inline file-upload\">
		<input type=\"text\" name=\"icon\" id=\"info_icon\" value=\"{\$r?\$r[''icon'']:''''}\" autocomplete=\"off\" class=\"layui-input\"/>
		<div class=\"layui-btn-group\">
			<button type=\"button\" class=\"layui-btn\" onclick=\"previewImg(''info_icon'')\"><i class=\"layui-icon\">&#xe64a;</i>预览</button>
			<button type=\"button\" class=\"layui-btn fastupimg\" data-input_id=\"info_icon\" data-listtype=\"img\" id=\"info_icon_Picker\"><i class=\"layui-icon\">&#xe608;</i>上传</button>
			<button type=\"button\" class=\"layui-btn\" onClick=\"selectfile(''info_icon'','''',''img'')\"><i class=\"layui-icon\">&#xe67c;</i>浏览</button>
		</div>
  </div>
</div>	');");
$this->E_D("replace into `db_cat_field` values('4','description1','描述','varchar','','text','','','','','|add|update|import_add|import_update|','1','0','0','0','0','1000','0','','<div class=\"layui-form-item\">
  <label class=\"layui-form-label\">{modelFieldTemp_name}<span></span></label>
  <div class=\"layui-input-inline\">
	<input type=\"text\"  placeholder=\"\" name=\"description1\" id=\"info_description1\" class=\"layui-input modelform_description1\" value=\"{\$r?\$r[''description1'']:''''}\" style=\"\" autocomplete=\"off\">
  </div>
</div>	');");
$this->E_D("replace into `db_cat_field` values('5','blank','是否新窗口打开','varchar','','text','','','','','|add|update|import_add|import_update|','1','0','0','0','0','1000','0','','<div class=\"layui-form-item\">
  <label class=\"layui-form-label\">{modelFieldTemp_name}<span></span></label>
  <div class=\"layui-input-inline\">
	<input type=\"text\"  placeholder=\"\" name=\"blank\" id=\"info_blank\" class=\"layui-input modelform_blank\" value=\"{\$r?\$r[''blank'']:''''}\" style=\"\" autocomplete=\"off\">
  </div>
</div>	');");
$this->E_D("replace into `db_cat_field` values('6','imagep','头部图片','varchar','','image','','','','','|add|update|import_add|import_update|','1','0','0','0','0','1000','0','','<div class=\"layui-form-item\">
  <label class=\"layui-form-label\">{modelFieldTemp_name}<span></span></label>
  <div class=\"layui-input-inline file-upload\">
		<input type=\"text\" name=\"imagep\" id=\"info_imagep\" value=\"{\$r?\$r[''imagep'']:''''}\" autocomplete=\"off\" class=\"layui-input\"/>
		<div class=\"layui-btn-group\">
			<button type=\"button\" class=\"layui-btn\" onclick=\"previewImg(''info_imagep'')\"><i class=\"layui-icon\">&#xe64a;</i>预览</button>
			<button type=\"button\" class=\"layui-btn fastupimg\" data-input_id=\"info_imagep\" data-listtype=\"img\" id=\"info_imagep_Picker\"><i class=\"layui-icon\">&#xe608;</i>上传</button>
			<button type=\"button\" class=\"layui-btn\" onClick=\"selectfile(''info_imagep'','''',''img'')\"><i class=\"layui-icon\">&#xe67c;</i>浏览</button>
		</div>
  </div>
</div>	');");
$this->E_D("replace into `db_cat_field` values('7','images','多图上传','longtext','','morepic','','','','','|add|update|','1','0','0','0','0','1000','0','','<div class=\"layui-form-item\">
	<label class=\"layui-form-label\">{modelFieldTemp_name}<span></span></label>
    <div class=\"layui-input-inline morepic\">
        <div class=\"morepic_box\">
            <div class=\"piclist\" data-field=\"images\">
                <ul id=\"images_piclist_ul\">
                    <?php
                    if(\$r){
                        \$morepic=\$r[''images''];
                        \$morepic_arr=explode(\"\\\\r\\\\n\",\$morepic);
                        foreach(\$morepic_arr as \$v){
                            if(!\$v){break;};
                            \$vs=explode(\"||\",\$v);
                    ?>
                    <li title=\"拖动我是可以排序的哦\" draggable=\"false\">
                        <a class=\"piclist_img images_fancybox\" rel=\"images_rel\" title=\"<?=\$vs[2]?>\" href=\"<?=\$vs[1]?>\">
                            <img src=\"<?=\$vs[0]?>\" draggable=\"false\">
                            <input type=\"hidden\" name=\"images_smallimg[]\" value=\"<?=\$vs[0]?>\">
                            <input type=\"hidden\" name=\"images_bigimg[]\" value=\"<?=\$vs[1]?>\">
                        </a>
                        <div class=\"piclist_title\"><input type=\"text\" name=\"images_imgname[]\" value=\"<?=\$vs[2]?>\"></div>
                        <div class=\"file-panel\"><span class=\"cancel\" onclick=\"delete_li(this)\" title=\"删除图片\">删除</span></div>
                    </li>
                    <?php
                        }                     
                    }
                    ?>
                    <li class=\"add_morepic\" id=\"images_add_button\" title=\"增加图片\" onclick=\"selectfiles(''images'',moreimg,''img'',''1000'','''')\">
                        <div class=\"piclist_img\">+</div>
                    </li>                                                
                    <div class=\"clear\"></div>
                </ul>
            </div>                                        
        </div>
    </div>
</div>');");
$this->E_D("replace into `db_cat_field` values('9','head_title','头部标题','varchar','','text','','','','','|add|update|import_add|import_update|','1','0','0','0','0','1000','0','','<div class=\"layui-form-item\">
  <label class=\"layui-form-label\">{modelFieldTemp_name}<span></span></label>
  <div class=\"layui-input-inline\">
	<input type=\"text\"  placeholder=\"\" name=\"head_title\" id=\"info_head_title\" class=\"layui-input modelform_head_title\" value=\"{\$r?\$r[''head_title'']:''''}\" style=\"\" autocomplete=\"off\">
  </div>
</div>	');");
$this->E_D("replace into `db_cat_field` values('10','icon2','背景图标','varchar','','image','','','','','|add|update|import_add|import_update|','1','0','0','0','0','1000','0','','<div class=\"layui-form-item\">
  <label class=\"layui-form-label\">{modelFieldTemp_name}<span></span></label>
  <div class=\"layui-input-inline file-upload\">
		<input type=\"text\" name=\"icon2\" id=\"info_icon2\" value=\"{\$r?\$r[''icon2'']:''''}\" autocomplete=\"off\" class=\"layui-input\"/>
		<div class=\"layui-btn-group\">
			<button type=\"button\" class=\"layui-btn\" onclick=\"previewImg(''info_icon2'')\"><i class=\"layui-icon\">&#xe64a;</i>预览</button>
			<button type=\"button\" class=\"layui-btn fastupimg\" data-input_id=\"info_icon2\" data-listtype=\"img\" id=\"info_icon2_Picker\"><i class=\"layui-icon\">&#xe608;</i>上传</button>
			<button type=\"button\" class=\"layui-btn\" onClick=\"selectfile(''info_icon2'','''',''img'')\"><i class=\"layui-icon\">&#xe67c;</i>浏览</button>
		</div>
  </div>
</div>	');");

 ?>